package com.tcoiss.log.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tcoiss.log.domain.OperLog;
import com.tcoiss.log.mapper.OperLogMapper;
import com.tcoiss.log.service.IOperLogService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 操作日志 服务层处理
 * 
 * @author tcoiss
 */
@Service
public class OperLogServiceImpl extends ServiceImpl<OperLogMapper, OperLog> implements IOperLogService
{


    /**
     * 查询系统操作日志集合
     * 
     * @param operLog 操作日志对象
     * @return 操作日志集合
     */
    @Override
    public List<OperLog> selectOperLogList(OperLog operLog)
    {
        LambdaQueryWrapper<OperLog> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(operLog.getOperName())) {
            lqw.eq(OperLog::getOperName, operLog.getOperName());
        }
        if (operLog.getOperId() != null) {
            lqw.eq(OperLog::getOperId, operLog.getOperId());
        }
        if (operLog.getOperatorType() != null) {
            lqw.eq(OperLog::getOperatorType, operLog.getOperatorType());
        }
        lqw.orderByDesc(OperLog::getOperTime);
        return this.list(lqw);
    }





}
